<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./lib/layui/css/layui.css">
</head>

<body>
  <button class="layui-btn layui-btn-danger">按钮</button>
  <div class="layui container">
    <div class="layui row">
      <div class="layui-col-md4">11</div>
      <div class="layui-col-md4">11</div>
      <div class="layui-col-md4">11</div>
      <div class="layui-col-md4">11</div>
      <div class="layui-col-md4">11</div>
      <div class="layui-col-md4">11</div>
    </div>
  </div>
  <div id="rate"></div>
  <script src="./lib/layui/layui.js"></script>
  <script>
    layui.use(['rate', 'jquery'], function () {
      // 使用变量接收引入成功的模块
      var rate = layui.rate;
      var $ = layui.jquery;
      var ins1 = rate.render({
        elem: '#rate',
        length: 10,
        value: 10,
        theme: '#55f',
        choose: function (value) {
          if (value > 8) alert('么么哒')
        }
      });
    });
  </script>
</body>

</html>